package top.jacktgq.logisticControl

/**
 @Author CandyWall
 @Date 2021/4/27--1:02
 @Description groovy中的switch-case语句
 */

def x = 1.23
def result
switch (x) {
    case 'foo':
        result = 'found foo'
        break
    case 'bar':
        result = 'bar'
        break
    case[4, 5, 6, 'inlist']:
        result = 'list'
        break
    case 12..30:
        result = 'range'
        break
    case Integer:
        result = 'integer'
        break
    case BigDecimal:
        result = 'bigDecimal'
        break
    default:
        result = 'default'
}

println result
